<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <style>
        .block,.test{
            width: 100px;
            height: 100px;
            position: relative;
            display: inline-block;
        }
        .block:nth-child(1){
            height: 2px;
            background: linear-gradient(90deg,transparent,#03e9f4);
        }
        .test1 span{
            height: 2px;
            position: absolute;
            display: block;
        }
        .test1 span:nth-child(1){
            top:0;
            left:-100%;
            width: 100%;
            height: 2px;
            background: linear-gradient(90deg,transparent,#03e9f4);
            animation:btn-anim1 2s linear infinite;
        }
        @keyframes btn-anim1{
            0% {
                left:-100%;
            }
            50%,100%{
                left:100%;
            }
        }
        .block:nth-child(2){
            width: 2px;
            background: linear-gradient(180deg,transparent,#03e9f4);
        }
        .block:nth-child(3){
            height: 2px;
            background: linear-gradient(270deg,transparent,#03e9f4);
        }
        .block:nth-child(4){
            width: 2px;
            background: linear-gradient(360deg,transparent,#03e9f4);
        }
    </style>
    <div>
        <div>
            <div class="block">123</div>
            <div class="block">123</div>
            <div class="block">123</div>
            <div class="block">123</div>
        </div>
        <div>
            <div class="test test1">
                <span></span>
            </div>
        </div>
        
        
    </div>
</body>
</html>